home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 883 b | 41 lines | [TEXT/CWIE] |
- // FreqPosting.h
- // Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
- // Struct used by TermIndex and its subclasses.
-
- #pragma once
- #ifndef FreqPosting_h
- #define FreqPosting_h
-
- #pragma import on
-
- #include "TermIndex.h"
-
- #pragma IA_BEGIN_EXPORTS
-
- // FreqPosting: represents an occurence of a term.
- struct FreqPosting {
- friend class InvertedIndex;
- public:
- FreqPosting() {}
- FreqPosting(DocID i, DocLength f) : docID(i), freq(f) {}
-
- void SetDocID (DocID docid) {docID = docid;}
- DocID GetDocID () {return docID;}
-
- void SetFreq (DocLength frequency) {freq = frequency;}
- DocLength GetFreq() {return freq;}
-
- private:
- void* operator new(size_t size); // stack or array allocate only
- DocID docID; // document the term occurred in
- DocLength freq; // number of times it occurred
-
- };
-
- #pragma IA_END_EXPORTS
-
- #pragma import reset
-
- #endif
-